package profile.hujia.profile.elasticsearch.study.controller;

import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.common.StopWatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import profile.hujia.profile.elasticsearch.study.model.SimulateInsertSourceEntity;
import profile.hujia.profile.elasticsearch.study.model.SourceEntity;
import profile.hujia.profile.elasticsearch.study.service.SourceService;
import profile.hujia.profile.elasticsearch.study.service.simulate.SimulateData;

import java.util.List;

/**
 * class info
 *
 * @author fuyaqi
 * @date 2019/9/26 13:56
 */
@RestController
@RequestMapping("/simulate")
@Slf4j
public class SimulateController {

    @Autowired
    private SourceService sourceService;

    @Autowired
    private SimulateData simulateData;

//    @GetMapping("/insert")
////    public void insert() {
//        try {
//            log.info("simulate begin");
//            List<SimulateInsertSourceEntity> data=simulateData.getListData();
//            log.info("simulate end");
//            StopWatch stopWatch=new StopWatch();
//            stopWatch.start();
//            sourceService.addSourceList(data);
//            stopWatch.stop();
//            log.info(stopWatch.prettyPrint());
//        } catch (Exception ex) {
//            log.error("error" + ex);
//            return;
//        }
//    }
}
